Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@axway/amplify-sdk

Package Overview
Dependencies
Maintainers
15
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axway/amplify-sdk

Axway AMPLIFY SDK for Node.js

  • 1.8.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1K
decreased by-9.79%
Maintainers
15
Weekly downloads
 
Created
Source

AMPLIFY SDK

The AMPLIFY SDK for Node.js is a set of APIs for authenticating, switching selected organization, creating MBS apps and users, and Titanium SDK support.

Installation

npm i @axway/amplify-sdk --save

Usage

import AmplifySDK from '@axway/amplify-sdk';

// opts can include `env` as well as any AMPLIFY Auth SDK constructor opts
// (see https://www.npmjs.com/package/@axway/amplify-auth-sdk)
const sdk = new AmplifySDK({ ...opts });

Auth

// get all authenticated accounts
const accounts = await sdk.auth.list();

// find an authenticated account by name and refresh access token if needed
let account = await.sdk.auth.find('foo');

// login using pkce browser-based flow
account = await sdk.auth.login();
console.log(account.org);
console.log(account.user);

// switch active org, assuming you belong to more than one
await sdk.auth.switchOrg(account, orgId);
console.log(`Active org is now ${account.org.name}`);

// log out of specific or all accounts
await sdk.auth.logout({ accounts: [ account ] });
// or: await sdk.auth.logout({ all: true });

// show auth server info
const info = await sdk.auth.serverInfo();
console.log(info);

MBS (formerly ACS)

// create an MBS app in each platform environment
const apps = await sdk.mbs.createApps(account, '<GUID>', '<NAME>');

// create a new MBS user for a given group id (app guid) and environment (production/development)
const user = await sdk.mbs.createUser(account, '<GROUP ID>', '<ENVIRONMENT>', {
	admin:         undefined,
	custom_fields: undefined,
	email:         'user@domain.com',
	first_name:    '',
	last_name:     '',
	password:      '', // required
	password_confirmation: '', // required
	photo_id:      undefined,
	role:          undefined,
	tags:          undefined,
	username:      undefined
});

// get all MBS users for a given group id (app guid) and environment (production/development)
const users = await sdk.mbs.getUsers(account, '<GROUP ID>', '<ENVIRONMENT>');

Orgs

// retrieve a list of all available platform environments such
// as 'production' and 'development'
const envs = await sdk.org.getEnvironments(account);
console.log(envs);

Titanium

// update Titanium app build info
await sdk.ti.buildUpdate(account, {
	buildId: 123,
	buildSHA: '<SHA>',
	keys: {
		'file1': 'key1',
		'file2': 'key2'
	}
});

// verify Titanium app and modules prior to a build
await sdk.ti.buildVerify(account, {
	appGuid:     '<GUID>',
	appId:       '<ID>',
	deployType:  'production',
	fingerprint: '<FINGERPRINT>',
	ipAddress:   '<IPADDRESS>',
	modules:     [],
	tiapp:       '<ti:app><name/><id/><guid/></ti:app>'
});

// create developer certificate
await sdk.ti.enroll(account, {
	description: '<CERTIFICATE DESCRIPTION>',
	fingerprint: '<FINGERPRINT>',
	publicKey: '<PUBLIC KEY>'
});

// get the URL for upload debug symbols after building an iOS app
const { url, api_token, limit } = await sdk.ti.getUploadURL(account, '<APP GUID>');

// get info about a Titanium app
const info = await sdk.ti.getApp(account, '<APP GUID>');

// the runtime app verification URL
const url = sdk.ti.getAppVerifyURL();

// get available Titanium module downloads
const downloads = await sdk.ti.getDownloads(account);

// update or register a Titanium app
await sdk.ti.setApp(account, '<ti:app><name/><id/><guid/></ti:app>');

Account Object

The AMPLIFY SDK relies on the AMPLIFY Auth SDK for authenticating and managing access tokens. For organization related information, it talks directly to the Axway platform.

account: {
	auth {
		authenticator: 'PKCE',
		baseUrl: 'https://login.axway.com',
		clientId: 'amplify-cli',
		env: {
			name: 'prod',
			baseUrl: 'https://login.axway.com',
			redirectLoginSuccess: 'https://platform.axway.com/'
		},
		expires: { access: 1587685009628, refresh: 1587700615628 },
		realm: 'Broker',
		tokens: {
			access_token: '<SNIP>',
			expires_in: 1800,
			refresh_expires_in: 17406,
			refresh_token: '<SNIP>',
			token_type: 'bearer',
			id_token: '<SNIP>',
			'not-before-policy': 1571719187,
			session_state: '<SNIP>',
			scope: 'openid'
		}
	},
	hash: 'amplify-cli:abcdef1234567890',
	name: 'amplify-cli:user@domain.com',
	org: {
		guid: '<GUID>',
		id: 12345,
		name: 'Example Org'
	},
	orgs: [
		{ /* org */ },
		{ /* org */ }
	],
	user: {
		axwayId:      '<SNIP>',
		email:        '',
		firstName:    '',
		guid:         '',
		lastName:     '',
		organization: '',
		is2FAEnabled: true
	},
	sid: '<SNIP>'
}

This project is open source under the Apache Public License v2 and is developed by Axway, Inc and the community. Please read the LICENSE file included in this distribution for more information.

Keywords

FAQs

Package last updated on 22 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc